import { WSAETIMEDOUT } from "constants";

let store = {
    state: {
        count: 0,
        arr: []
    },
    mutations: {
        add(state){
            state.count++;
        },
        reduce(state){
            state.count--;
        },
        arrayadd(state, a){
            state.arr = a.map(item =>{
                item ++;
                return item;
            })
        }
    },
    actions: {
        addmax(context){
            context.commit('add');
        },
        reducemax(context){
            context.commit('reduce');
        },
        arrayaddmax({commit}){
            let a = [1, 2, 3, 4, 5];
            commit('arrayadd', a);
        }
    },
    getters: {
        arrmap1: state => state.arr
    }
}

export default store;